package com.xmkj.bearbiz.member;

import android.content.Context;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;
import android.util.SparseArray;

public class ModifyPagerAdapter extends FragmentPagerAdapter {
        SparseArray<String> titles;
        Context context;
    String deptcode;
    String vipcardid;

    public ModifyPagerAdapter(FragmentManager fm) {
        super(fm);
    }

    public ModifyPagerAdapter(FragmentManager supportFragmentManager, SparseArray<String> titles, Context context ,String deptcode, String vipcardid ) {
        super(supportFragmentManager);
        this.titles = titles;
        this.context = context;
        this.deptcode = deptcode;
        this.vipcardid = vipcardid;
    }

    @Override
    public Fragment getItem(int position) {
        if (position == 0) {
            return new BaseInfoFragment(deptcode,vipcardid);
        } else if (position == 1) {
            return new LifeStyleFragment(deptcode,vipcardid);
        } else {
            return new DressStyleFragment(deptcode,vipcardid);
        }
    }

    @Override
    public int getCount() {
        return titles == null ? 0 : titles.size();
    }

    @Override
    public CharSequence getPageTitle(int position) {
        return titles.get(position);
    }
}
